package com.atguigu.jxc.dao;


import com.atguigu.jxc.entity.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsDao {
    //查询首页
    List<Goods> selectGoodsList(@Param("offSet") Integer offSet,
                                @Param("pageRow") Integer pageRow,
                                @Param("codeOrName") String codeOrName,
                                @Param("goodsTypeId") Integer goodsTypeId);
    //新增商品
    void saveGoods(Goods goods);

    //修改商品
    void updateGoods(@Param("goods") Goods goods,
                     @Param("goodsId") String goodsId);

    //通过查询商品
    List<Goods> selectStateByGoodsId(Integer goodsId);
    //删除
    void deleteGoods(Integer goodsId);

    List<Goods> selectNoInventory(@Param("offSet")int offSet,
                                  @Param("pageRow") Integer pageRow,
                                  @Param("nameOrCode") String nameOrCode);

    List<Goods> selectHasInventory(@Param("offSet")int offSet,
                                   @Param("pageRow") Integer pageRow,
                                   @Param("nameOrCode") String nameOrCode);

    void saveStock(@Param("goodsId")Integer goodsId,
                   @Param("inventoryQuantity")Integer inventoryQuantity,
                   @Param("purchasingPrice") double purchasingPrice);


    //删除库存
    void deleteStock(Integer goodsId);

    //库存警告
    List<Goods> listAlarm();

}
